package src.main.java.org.oop.extend;

public class Teacher extends People{
    private String skill;

    String name = "子类名称";

    public void showName(){
        String name = "局部名称";
        System.out.println(name); //局部名称
        System.out.println(this.name); //子类成员变量
        System.out.println(super.name);//父类成员变量
    }
    public Teacher(String name,int age,String skill){
        super(name,age);   //调用父类的name和age
        this.skill = skill; //调用自己的skill
    }

    @Override
    public String getName() {
        return super.getName();
    }

    @Override
    public void setName(String name) {
        super.setName(name);
    }

    public String getSkill() {
        return skill;
    }

    public void setSkill(String skill) {
        this.skill = skill;
    }

    public void printInfo(){
        System.out.println(getName()+"具备的技能"+skill);
    }
}
